import request from '@/utils/request';

export function changeOwnInfo(data){
  return request({
    url:"/system/student/changeOwnInfo",
    method:"POST",
    data
  });
}

export function getOwnInfo() {
  return request({
    url: "/system/student/getOwnInfo",
    method: "get"
  });
}

export function listEnableStu() {
  return request({
    url: "/system/student/listEnableStu",
    method: "get"
  });
}

export function initOnePwd(data) {
  return request({
    url: "/system/student/updateUserPwds",
    method: "post",
    data
  })
}

export function initPwd() {
  return request({
    url: "/system/student/initializePwd",
    method: "post"
  });
}

export function getOwnClass() {
  return request({
    url: "/system/student/getOwnClass",
    method: "get"
  })
}

//tree学生
export function treeStudent() {
  return request({
    url: "/system/student/name",
    method: "get"
  });
}

export function listOwnStu(query) {
  return request({
    url: '/system/student/listOwnStu',
    method: 'get',
    params: query
  })
}

// 查询学生信息列表
export function listStudent(query) {
  return request({
    url: '/system/student/list',
    method: 'get',
    params: query
  })
}
// 查询班级信息列表
export function listclass(query) {
  return request({
    url: '/system/class/list',
    method: 'get',
    params: query
  })
}
// 查询班级列表及上级
export function getClassName(query) {
  return request({
    url: '/system/class/name',
    method: 'get',
    params: query
  })
}

// 查询学生信息详细
export function getStudent(stuId) {
  return request({
    url: '/system/student/' + stuId,
    method: 'get'
  })
}

// 新增学生信息
export function addStudent(data) {
  return request({
    url: '/system/student',
    method: 'post',
    data: data
  })
}

// 修改学生信息
export function updateStudent(data) {
  return request({
    url: '/system/student/update',
    method: 'post',
    data: data
  })
}

// 删除学生信息
export function delStudent(stuId) {
  return request({
    url: '/system/student/delete/' + stuId,
    method: 'post'
  })
}

// 查询学生信息列表
export function listAllStudent(query) {
  return request({
    url: '/system/student/listAll',
    method: 'get',
    params: query
  })
}
